﻿using RayDen.Library.Core.Primitives;

namespace RayDen.Library.Entity.SceneGraph {
    public class DataNode<TDataItem> : SceneGraphElement {
        protected TDataItem data;

        public DataNode(Transform o2w, Transform w2o, TDataItem data)
            : base(o2w, w2o) {
            this.data = data;
        }

        public override object GetDataItem() {
            return data;
        }
        protected override SceneGraphElement CloneInternal() {
            return new DataNode<TDataItem>(ObjectToWorld, WorldToObject, data) { Id = Id };
        }
    }
}